package com.ai.wx.service.impl;

import java.util.HashMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.core.dao.BaseDaoI;
import com.ai.wx.entity.AgentPromotion;
import com.ai.wx.service.AgentPromotionService;


@Service
public class AgentPromotionServiceImpl implements AgentPromotionService {

	@Autowired
	private BaseDaoI<AgentPromotion> agentPromoitonDao;
	public AgentPromotion getAgentPromotionByCode(String promotionCode) {
		String hql = "from AgentPromotion where promotionCode =:promotionCode and state = 1";

		HashMap params = new HashMap();
		params.put("promotionCode", promotionCode); 
		AgentPromotion agentPromoiton = agentPromoitonDao.get(hql,params); 
		return agentPromoiton; 
	}
	
	
}
